import hasRole from './hasRole'
import hasPermi from './hasPermi'
import nonHasRole from './nonHasRole'
import nonHasPermi from './nonHasPermi'
import judgeAccount from './judgeAccount'

const install = function(Vue) {
  Vue.directive('hasRole', hasRole)
  Vue.directive('hasPermi', hasPermi)
  Vue.directive('nonHasRole', nonHasRole)
  Vue.directive('nonHasPermi', nonHasPermi)
  Vue.directive('judgeAccount', judgeAccount)
}

if (window.Vue) {
  window['hasRole'] = hasRole
  window['hasPermi'] = hasPermi
  window['nonHasRole'] = nonHasRole
  window['nonHasPermi'] = nonHasPermi
  window['judgeAccount'] = judgeAccount
  Vue.use(install); // eslint-disable-line
}

export default install
